/*
*                             ______ _____  _______ 
* .-----..--.--..----..-----.|   __ \     \|    ___|
* |  _  ||  |  ||   _||  -__||    __/  --  |    ___|
* |   __||_____||__|  |_____||___|  |_____/|___|    
* |__|
* $Id: BidiOrderTypes.as 238 2010-01-31 10:49:33Z alessandro.crugnola $
* $Author Alessandro Crugnola $
* $Rev: 238 $ $LastChangedDate: 2010-01-31 10:49:33 +0000 (Sun, 31 Jan 2010) $
* $URL: http://purepdf.googlecode.com/svn/trunk/src/org/purepdf/pdf/BidiOrderTypes.as $
*
* The contents of this file are subject to  LGPL license
* (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the
* provisions of LGPL are applicable instead of those above.  If you wish to
* allow use of your version of this file only under the terms of the LGPL
* License and not to allow others to use your version of this file under
* the MPL, indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by the LGPL.
* If you do not delete the provisions above, a recipient may use your version
* of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the License.
*
* The Original Code is 'iText, a free JAVA-PDF library' ( version 4.2 ) by Bruno Lowagie.
* All the Actionscript ported code and all the modifications to the
* original java library are written by Alessandro Crugnola (alessandro@sephiroth.it)
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the MPL as stated above or under the terms of the GNU
* Library General Public License as published by the Free Software Foundation;
* either version 2 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU LIBRARY GENERAL PUBLIC LICENSE for more
* details
*
* If you didn't download this code from the following link, you should check if
* you aren't using an obsolete version:
* http://code.google.com/p/purepdf
*
*/
package org.purepdf.pdf
{
	import flash.system.ApplicationDomain;
	import flash.utils.ByteArray;
	
	import org.purepdf.utils.AlchemyUtils;
	
	public final class BidiOrderTypes
	{
		internal static function init(): void
		{
			if( rTypes.length == 0 )
			{
				var offset: int = AlchemyUtils.getLib().getrtypes();
				var len: int = 65536;
				
				rTypes.writeBytes( ApplicationDomain.currentDomain.domainMemory, offset, len );
			}
		}
		
		internal static const rTypes: ByteArray = new ByteArray();
		
		internal static const baseTypes: Vector.<int> = Vector.<int>( [0, 8, 14, 9, 9, 16, 10, 10, 15, 11, 11, 16, 12, 12, 17, 13,
			13, 15, 14, 27, 14, 28, 30, 15, 31, 31, 16, 32, 32, 17, 33, 34, 18, 35, 37, 10, 38, 42, 18, 43, 43, 10, 44,
			44, 12, 45, 45, 10, 46, 46, 12, 47, 47, 9, 48, 57, 8, 58, 58, 12, 59, 64, 18, 65, 90, 0, 91, 96, 18, 97,
			122, 0, 123, 126, 18, 127, 132, 14, 133, 133, 15, 134, 159, 14, 160, 160, 12, 161, 161, 18, 162, 165, 10,
			166, 169, 18, 170, 170, 0, 171, 175, 18, 176, 177, 10, 178, 179, 8, 180, 180, 18, 181, 181, 0, 182, 184, 18,
			185, 185, 8, 186, 186, 0, 187, 191, 18, 192, 214, 0, 215, 215, 18, 216, 246, 0, 247, 247, 18, 248, 696, 0,
			697, 698, 18, 699, 705, 0, 706, 719, 18, 720, 721, 0, 722, 735, 18, 736, 740, 0, 741, 749, 18, 750, 750, 0,
			751, 767, 18, 768, 855, 13, 856, 860, 0, 861, 879, 13, 880, 883, 0, 884, 885, 18, 886, 893, 0, 894, 894, 18,
			895, 899, 0, 900, 901, 18, 902, 902, 0, 903, 903, 18, 904, 1013, 0, 1014, 1014, 18, 1015, 1154, 0, 1155,
			1158, 13, 1159, 1159, 0, 1160, 1161, 13, 1162, 1417, 0, 1418, 1418, 18, 1419, 1424, 0, 1425, 1441, 13, 1442,
			1442, 0, 1443, 1465, 13, 1466, 1466, 0, 1467, 1469, 13, 1470, 1470, 3, 1471, 1471, 13, 1472, 1472, 3, 1473,
			1474, 13, 1475, 1475, 3, 1476, 1476, 13, 1477, 1487, 0, 1488, 1514, 3, 1515, 1519, 0, 1520, 1524, 3, 1525,
			1535, 0, 1536, 1539, 4, 1540, 1547, 0, 1548, 1548, 12, 1549, 1549, 4, 1550, 1551, 18, 1552, 1557, 13, 1558,
			1562, 0, 1563, 1563, 4, 1564, 1566, 0, 1567, 1567, 4, 1568, 1568, 0, 1569, 1594, 4, 1595, 1599, 0, 1600,
			1610, 4, 1611, 1624, 13, 1625, 1631, 0, 1632, 1641, 11, 1642, 1642, 10, 1643, 1644, 11, 1645, 1647, 4, 1648,
			1648, 13, 1649, 1749, 4, 1750, 1756, 13, 1757, 1757, 4, 1758, 1764, 13, 1765, 1766, 4, 1767, 1768, 13, 1769,
			1769, 18, 1770, 1773, 13, 1774, 1775, 4, 1776, 1785, 8, 1786, 1805, 4, 1806, 1806, 0, 1807, 1807, 14, 1808,
			1808, 4, 1809, 1809, 13, 1810, 1839, 4, 1840, 1866, 13, 1867, 1868, 0, 1869, 1871, 4, 1872, 1919, 0, 1920,
			1957, 4, 1958, 1968, 13, 1969, 1969, 4, 1970, 2304, 0, 2305, 2306, 13, 2307, 2363, 0, 2364, 2364, 13, 2365,
			2368, 0, 2369, 2376, 13, 2377, 2380, 0, 2381, 2381, 13, 2382, 2384, 0, 2385, 2388, 13, 2389, 2401, 0, 2402,
			2403, 13, 2404, 2432, 0, 2433, 2433, 13, 2434, 2491, 0, 2492, 2492, 13, 2493, 2496, 0, 2497, 2500, 13, 2501,
			2508, 0, 2509, 2509, 13, 2510, 2529, 0, 2530, 2531, 13, 2532, 2545, 0, 2546, 2547, 10, 2548, 2560, 0, 2561,
			2562, 13, 2563, 2619, 0, 2620, 2620, 13, 2621, 2624, 0, 2625, 2626, 13, 2627, 2630, 0, 2631, 2632, 13, 2633,
			2634, 0, 2635, 2637, 13, 2638, 2671, 0, 2672, 2673, 13, 2674, 2688, 0, 2689, 2690, 13, 2691, 2747, 0, 2748,
			2748, 13, 2749, 2752, 0, 2753, 2757, 13, 2758, 2758, 0, 2759, 2760, 13, 2761, 2764, 0, 2765, 2765, 13, 2766,
			2785, 0, 2786, 2787, 13, 2788, 2800, 0, 2801, 2801, 10, 2802, 2816, 0, 2817, 2817, 13, 2818, 2875, 0, 2876,
			2876, 13, 2877, 2878, 0, 2879, 2879, 13, 2880, 2880, 0, 2881, 2883, 13, 2884, 2892, 0, 2893, 2893, 13, 2894,
			2901, 0, 2902, 2902, 13, 2903, 2945, 0, 2946, 2946, 13, 2947, 3007, 0, 3008, 3008, 13, 3009, 3020, 0, 3021,
			3021, 13, 3022, 3058, 0, 3059, 3064, 18, 3065, 3065, 10, 3066, 3066, 18, 3067, 3133, 0, 3134, 3136, 13,
			3137, 3141, 0, 3142, 3144, 13, 3145, 3145, 0, 3146, 3149, 13, 3150, 3156, 0, 3157, 3158, 13, 3159, 3259, 0,
			3260, 3260, 13, 3261, 3275, 0, 3276, 3277, 13, 3278, 3392, 0, 3393, 3395, 13, 3396, 3404, 0, 3405, 3405, 13,
			3406, 3529, 0, 3530, 3530, 13, 3531, 3537, 0, 3538, 3540, 13, 3541, 3541, 0, 3542, 3542, 13, 3543, 3632, 0,
			3633, 3633, 13, 3634, 3635, 0, 3636, 3642, 13, 3643, 3646, 0, 3647, 3647, 10, 3648, 3654, 0, 3655, 3662, 13,
			3663, 3760, 0, 3761, 3761, 13, 3762, 3763, 0, 3764, 3769, 13, 3770, 3770, 0, 3771, 3772, 13, 3773, 3783, 0,
			3784, 3789, 13, 3790, 3863, 0, 3864, 3865, 13, 3866, 3892, 0, 3893, 3893, 13, 3894, 3894, 0, 3895, 3895, 13,
			3896, 3896, 0, 3897, 3897, 13, 3898, 3901, 18, 3902, 3952, 0, 3953, 3966, 13, 3967, 3967, 0, 3968, 3972, 13,
			3973, 3973, 0, 3974, 3975, 13, 3976, 3983, 0, 3984, 3991, 13, 3992, 3992, 0, 3993, 4028, 13, 4029, 4037, 0,
			4038, 4038, 13, 4039, 4140, 0, 4141, 4144, 13, 4145, 4145, 0, 4146, 4146, 13, 4147, 4149, 0, 4150, 4151, 13,
			4152, 4152, 0, 4153, 4153, 13, 4154, 4183, 0, 4184, 4185, 13, 4186, 5759, 0, 5760, 5760, 17, 5761, 5786, 0,
			5787, 5788, 18, 5789, 5905, 0, 5906, 5908, 13, 5909, 5937, 0, 5938, 5940, 13, 5941, 5969, 0, 5970, 5971, 13,
			5972, 6001, 0, 6002, 6003, 13, 6004, 6070, 0, 6071, 6077, 13, 6078, 6085, 0, 6086, 6086, 13, 6087, 6088, 0,
			6089, 6099, 13, 6100, 6106, 0, 6107, 6107, 10, 6108, 6108, 0, 6109, 6109, 13, 6110, 6127, 0, 6128, 6137, 18,
			6138, 6143, 0, 6144, 6154, 18, 6155, 6157, 13, 6158, 6158, 17, 6159, 6312, 0, 6313, 6313, 13, 6314, 6431, 0,
			6432, 6434, 13, 6435, 6438, 0, 6439, 6443, 13, 6444, 6449, 0, 6450, 6450, 13, 6451, 6456, 0, 6457, 6459, 13,
			6460, 6463, 0, 6464, 6464, 18, 6465, 6467, 0, 6468, 6469, 18, 6470, 6623, 0, 6624, 6655, 18, 6656, 8124, 0,
			8125, 8125, 18, 8126, 8126, 0, 8127, 8129, 18, 8130, 8140, 0, 8141, 8143, 18, 8144, 8156, 0, 8157, 8159, 18,
			8160, 8172, 0, 8173, 8175, 18, 8176, 8188, 0, 8189, 8190, 18, 8191, 8191, 0, 8192, 8202, 17, 8203, 8205, 14,
			8206, 8206, 0, 8207, 8207, 3, 8208, 8231, 18, 8232, 8232, 17, 8233, 8233, 15, 8234, 8234, 1, 8235, 8235, 5,
			8236, 8236, 7, 8237, 8237, 2, 8238, 8238, 6, 8239, 8239, 17, 8240, 8244, 10, 8245, 8276, 18, 8277, 8278, 0,
			8279, 8279, 18, 8280, 8286, 0, 8287, 8287, 17, 8288, 8291, 14, 8292, 8297, 0, 8298, 8303, 14, 8304, 8304, 8,
			8305, 8307, 0, 8308, 8313, 8, 8314, 8315, 10, 8316, 8318, 18, 8319, 8319, 0, 8320, 8329, 8, 8330, 8331, 10,
			8332, 8334, 18, 8335, 8351, 0, 8352, 8369, 10, 8370, 8399, 0, 8400, 8426, 13, 8427, 8447, 0, 8448, 8449, 18,
			8450, 8450, 0, 8451, 8454, 18, 8455, 8455, 0, 8456, 8457, 18, 8458, 8467, 0, 8468, 8468, 18, 8469, 8469, 0,
			8470, 8472, 18, 8473, 8477, 0, 8478, 8483, 18, 8484, 8484, 0, 8485, 8485, 18, 8486, 8486, 0, 8487, 8487, 18,
			8488, 8488, 0, 8489, 8489, 18, 8490, 8493, 0, 8494, 8494, 10, 8495, 8497, 0, 8498, 8498, 18, 8499, 8505, 0,
			8506, 8507, 18, 8508, 8511, 0, 8512, 8516, 18, 8517, 8521, 0, 8522, 8523, 18, 8524, 8530, 0, 8531, 8543, 18,
			8544, 8591, 0, 8592, 8721, 18, 8722, 8723, 10, 8724, 9013, 18, 9014, 9082, 0, 9083, 9108, 18, 9109, 9109, 0,
			9110, 9168, 18, 9169, 9215, 0, 9216, 9254, 18, 9255, 9279, 0, 9280, 9290, 18, 9291, 9311, 0, 9312, 9371, 8,
			9372, 9449, 0, 9450, 9450, 8, 9451, 9751, 18, 9752, 9752, 0, 9753, 9853, 18, 9854, 9855, 0, 9856, 9873, 18,
			9874, 9887, 0, 9888, 9889, 18, 9890, 9984, 0, 9985, 9988, 18, 9989, 9989, 0, 9990, 9993, 18, 9994, 9995, 0,
			9996, 10023, 18, 10024, 10024, 0, 10025, 10059, 18, 10060, 10060, 0, 10061, 10061, 18, 10062, 10062, 0,
			10063, 10066, 18, 10067, 10069, 0, 10070, 10070, 18, 10071, 10071, 0, 10072, 10078, 18, 10079, 10080, 0,
			10081, 10132, 18, 10133, 10135, 0, 10136, 10159, 18, 10160, 10160, 0, 10161, 10174, 18, 10175, 10191, 0,
			10192, 10219, 18, 10220, 10223, 0, 10224, 11021, 18, 11022, 11903, 0, 11904, 11929, 18, 11930, 11930, 0,
			11931, 12019, 18, 12020, 12031, 0, 12032, 12245, 18, 12246, 12271, 0, 12272, 12283, 18, 12284, 12287, 0,
			12288, 12288, 17, 12289, 12292, 18, 12293, 12295, 0, 12296, 12320, 18, 12321, 12329, 0, 12330, 12335, 13,
			12336, 12336, 18, 12337, 12341, 0, 12342, 12343, 18, 12344, 12348, 0, 12349, 12351, 18, 12352, 12440, 0,
			12441, 12442, 13, 12443, 12444, 18, 12445, 12447, 0, 12448, 12448, 18, 12449, 12538, 0, 12539, 12539, 18,
			12540, 12828, 0, 12829, 12830, 18, 12831, 12879, 0, 12880, 12895, 18, 12896, 12923, 0, 12924, 12925, 18,
			12926, 12976, 0, 12977, 12991, 18, 12992, 13003, 0, 13004, 13007, 18, 13008, 13174, 0, 13175, 13178, 18,
			13179, 13277, 0, 13278, 13279, 18, 13280, 13310, 0, 13311, 13311, 18, 13312, 19903, 0, 19904, 19967, 18,
			19968, 42127, 0, 42128, 42182, 18, 42183, 64284, 0, 64285, 64285, 3, 64286, 64286, 13, 64287, 64296, 3,
			64297, 64297, 10, 64298, 64310, 3, 64311, 64311, 0, 64312, 64316, 3, 64317, 64317, 0, 64318, 64318, 3,
			64319, 64319, 0, 64320, 64321, 3, 64322, 64322, 0, 64323, 64324, 3, 64325, 64325, 0, 64326, 64335, 3, 64336,
			64433, 4, 64434, 64466, 0, 64467, 64829, 4, 64830, 64831, 18, 64832, 64847, 0, 64848, 64911, 4, 64912,
			64913, 0, 64914, 64967, 4, 64968, 65007, 0, 65008, 65020, 4, 65021, 65021, 18, 65022, 65023, 0, 65024,
			65039, 13, 65040, 65055, 0, 65056, 65059, 13, 65060, 65071, 0, 65072, 65103, 18, 65104, 65104, 12, 65105,
			65105, 18, 65106, 65106, 12, 65107, 65107, 0, 65108, 65108, 18, 65109, 65109, 12, 65110, 65118, 18, 65119,
			65119, 10, 65120, 65121, 18, 65122, 65123, 10, 65124, 65126, 18, 65127, 65127, 0, 65128, 65128, 18, 65129,
			65130, 10, 65131, 65131, 18, 65132, 65135, 0, 65136, 65140, 4, 65141, 65141, 0, 65142, 65276, 4, 65277,
			65278, 0, 65279, 65279, 14, 65280, 65280, 0, 65281, 65282, 18, 65283, 65285, 10, 65286, 65290, 18, 65291,
			65291, 10, 65292, 65292, 12, 65293, 65293, 10, 65294, 65294, 12, 65295, 65295, 9, 65296, 65305, 8, 65306,
			65306, 12, 65307, 65312, 18, 65313, 65338, 0, 65339, 65344, 18, 65345, 65370, 0, 65371, 65381, 18, 65382,
			65503, 0, 65504, 65505, 10, 65506, 65508, 18, 65509, 65510, 10, 65511, 65511, 0, 65512, 65518, 18, 65519,
			65528, 0, 65529, 65531, 14, 65532, 65533, 18, 65534, 65535, 0] );
	}
}